-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
platform/node/index.js
Outdated
@@ -19,7 +19,12 @@ var Map = function(options) { | |||
return new constructor(Object.assign(options, { | |||
request: function(req) { | |||
request(req, function() { | |||
req.respond.apply(req, arguments); | |||
var args = arguments; | |||
// Protect ourselves from `request` implementations that try to release Zalgo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what Zalgo is without googling. Can we use a clearer phrasing of the issue here please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, that was overly snarky. I've rephrased the comment, and kept the link for further background.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I saw the link, but even then it took me a while to understand that it refers to a meme. Thanks for updating!
platform/node/index.js
Outdated
var args = arguments; | ||
// Protect ourselves from `request` implementations that try to release Zalgo. | ||
// http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony | ||
setImmediate(function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to use setImmediate
instead of process.nextTick
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really. Sounds like process.nextTick
is in fact more "immediate" than setImmediate
. It probably doesn't matter though.
Fixes #8812.